import static org.junit.Assert.*;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;


public class TestWithFixtures
{
	static int num = 0;
	static int count = 0;

	@BeforeClass
	public static void setUpBeforeClass() throws Exception
	{
		System.out.println("TestWithFixtures(): setUpBeforeClass");
		num = 10;
		count++;
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception
	{
		System.out.println("TestWithFixtures(): tearDownAfterClass");
		num = 20;
		count++;
	}

	@Before
	public void setUp() throws Exception
	{
		System.out.println("TestWithFixtures(): setUp");
		num = 1;
		count++;
	}

	@After
	public void tearDown() throws Exception
	{
		System.out.println("TestWithFixtures(): tearDown");
		num = 2;
		count++;
	}

	@Test
	public void test1()
	{
		System.out.println("TestWithFixtures(): test1");
		assertEquals(num, 1);
		assertEquals(count, 2);
	}
	
	@Test
	public void test2()
	{
		System.out.println("TestWithFixtures(): test2");
		assertEquals(num, 1);
		assertEquals(count, 4);
	}

}
